#/bin/bash

psid=`ps aux | grep ticket_monitor | grep python | awk '{print $2}'`
if [ -n $psid ]
then
  echo "psid:$psid"
  kill -9 "${psid}"
fi
echo "starting ticket_monitor..."
nohup python3 ticket_monitor.py > nohup.log 2>&1 &
psid=`ps aux | grep ticket_monitor | grep python | awk '{print $2}'`
if [ -n $psid ]
then
  echo "start ticket_monitor successfully"
else
  echo "start ticket_monitor failed"
fi
exit 0
